-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'Solution' #339
base: master
Are you sure you want to change the base?
'Solution' #339
Conversation
app/customer.py
Outdated
products_price = 0 | ||
for product, amount in self.products_cart.items(): | ||
products_price += shop.products[product] * amount | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use sum() function
app/main.py
Outdated
best_shop[0] = shop | ||
best_shop[1] = trip_price |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
best_shop[0] = shop | |
best_shop[1] = trip_price | |
best_shop = [shop, trip_price] |
app/shop.py
Outdated
self.products = products | ||
|
||
def receipt(self, customer: object) -> str: | ||
date = datetime(2021, 1, 4, 12, 33, 41) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to hardcode it
app/shop.py
Outdated
self.products = products | ||
|
||
def receipt(self, customer: object) -> str: | ||
date = datetime.now() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tests failed. To fix them do not use
from datetime import datetime
instead use
import datetime
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done!
No description provided.